package com.mcintyret.site.web.controller;

import com.mcintyret.site.journal.database.JournalDao;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;

/**
 * User: mcintyret2
 * Date: 27/03/2012
 */

@Controller
public class BasicController extends BaseController {

    @Resource
    private JournalDao journalDao;

    @RequestMapping("/home")
    private void homePage(Model model) {
        model.addAttribute("origin", "home");

        model.addAttribute("journalFamilies", journalDao.getAllJournalFamilies());

        setupCommonElements(model);
    }

    @RequestMapping({"**/favicon.ico", "/favicon.ico"})
    private String favIconForward() {
        return "forward:/images/fav.ico";
    }

    @RequestMapping("/")
    private String getHomePageFromRoot() {
        return "redirect:/home";
    }

    @RequestMapping("/login")
    private void login() {

    }


}
